home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / interapplication comm / aecdev.aedaemon / aedaemon.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  3.2 KB  |  113 lines

  1. /*
  2.     File:        AEDaemon.h
  3.  
  4.     Contains:    
  5.  
  6.     Written by:     
  7.  
  8.     Copyright:    Copyright © 1991-1999 by Apple Computer, Inc., All Rights Reserved.
  9.  
  10.                 You may incorporate this Apple sample source code into your program(s) without
  11.                 restriction. This Apple sample source code has been provided "AS IS" and the
  12.                 responsibility for its operation is yours. You are not permitted to redistribute
  13.                 this Apple sample source code as "Apple sample source code" after having made
  14.                 changes. If you're going to re-distribute the source, we require that you make
  15.                 it clear in the source that the code was descended from Apple sample source
  16.                 code, but that you've made changes.
  17.  
  18.     Change History (most recent first):
  19.                 7/20/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  20.                 
  21.  
  22. */
  23. #include <Types.h>
  24. #include <Memory.h>
  25. #include <Quickdraw.h>
  26. #include <TextEdit.h>
  27. #include <Dialogs.h>
  28. #include <Devices.h>
  29. #include <Scrap.h>
  30. #include <menus.h> 
  31. #include <PPCToolbox.h>
  32. #include <AppleEvents.h>
  33. #include <StandardFile.h>
  34. #include <EPPC.h>
  35. #include <Aliases.h>
  36. #include <events.h>
  37. #include <gestaltequ.h>
  38. #include <ToolUtils.h>
  39.  
  40. /* Types */
  41. struct MyPPCRec {
  42. PPCParamBlockRec    pB;
  43. Ptr        buffer;        /* buffer we're using */
  44. Size bufferSize;    /* guess */
  45. Handle dataToXfer;
  46. PPCPortPtr myPort;
  47. PPCPortPtr buddyPortPtr;
  48. PPCPortRefNum ourPort;
  49. PPCSessRefNum currentSessionRef;
  50.  
  51. };
  52. typedef struct MyPPCRec MyPPCRec, *MyPPCRecPtr,**MyPPCRecHandle;
  53.  
  54.  
  55. typedef struct CDEVRec {
  56. Handle spare;
  57. MyPPCRecPtr myPPCBlock;
  58. /* LocationName won't be needed, since we're staying local */
  59. Boolean searchForTarget;  /* searchForTarget is our flag to tell us that we do not */
  60.                         /* know where AEBuddy is yet, and we have to keep looking. */
  61.                         /*  It also implies (if true) that PBCat has already been */
  62.                         /* called, if necessary */
  63. Boolean noBuddy;        /* PBCatSearch failed, give it up */
  64. Boolean notSys7;
  65. Boolean eventPending;
  66. } CDEVRec, *CDEVPtr, **CDEVHnd;
  67.  
  68.  
  69. struct MyPPCRecDeamon { /* to differentiate it from the one I'm using in the CDEV */
  70. PPCParamBlockRec    pB;
  71. Ptr        buffer;        /* buffer we're using */
  72. Size bufferSize;    /* guess */
  73. Handle dataToXfer;
  74. PPCPortPtr myPort;
  75. PPCPortRefNum ourPort;
  76. PPCSessRefNum currentSessionRef;
  77. };
  78.  
  79. typedef struct MyPPCRecDeamon MyPPCRecDeamon, *MyPPCRecPtrDeamon,**MyPPCRecHandleDeamon;
  80.  
  81.  
  82. #define kOneK 1024
  83. #define kSendButton 1
  84. #define kNoBuddyAlert -4048
  85. #define kNot70 -4049
  86. #define kStringsID -4048
  87. #define kBrowse1 1
  88. #define kBrowse2 2
  89. #define kMyName 3
  90. #define kWatchCursor 4
  91.  
  92. enum  {
  93.   kMyTypeOfData    = 0x4D415654, // 'MAVT'
  94.   kGenericCreator  = 0x3F3F3F3F // '????'
  95. };
  96.  
  97.  
  98. void InitAEStuff(void);
  99. void DoHighLevel(EventRecord *AERecord);
  100. pascal OSErr AEOpenHandler(AppleEvent *messagein, AppleEvent *reply, long refIn);
  101. pascal OSErr AEOpenDocHandler(AppleEvent *messagein, AppleEvent *reply, long refIn);
  102. pascal OSErr AEPrintHandler(AppleEvent *messagein, AppleEvent *reply, long refIn);
  103. pascal OSErr AEQuitHandler(AppleEvent *messagein, AppleEvent *reply, long refIn);
  104. Boolean InformTheWorld(void);
  105. OSErr OpenAPort(PPCOpenPBPtr myPort);
  106. Boolean DoInform(PPCInformPBPtr p);
  107. void CloseOffTheWorld(void);
  108. void OpenComplete(PPCInformPBPtr p);
  109. void InformComplete(PPCReadPBPtr p);
  110. void ReadComplete(PPCReadPBPtr p);
  111. void CollectLastData(void);
  112.  
  113.